﻿using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Threading;
using System.Windows;
using MusicStore.Dashboard.Client.SalesServiceReference;
using MusicStore.Wpf.Toolkit;
using MusicStore.Wpf.Toolkit.Commands;

namespace MusicStore.Dashboard.Client.Commands
{
  public abstract class LoadSalesCommandBase<TSale> : ServiceCommandBase<ISales, SalesClient>
  {
    public static readonly DependencyProperty SalesProperty =
      DependencyProperty.Register("Sales", typeof (ObservableCollection<TSale>), typeof (LoadSalesCommandBase<TSale>), null);

    public ObservableCollection<TSale> Sales
    {
      get { return (ObservableCollection<TSale>) GetValue(SalesProperty); }
      set { SetValue(SalesProperty, value); }
    }

    protected override bool CanExecute(SalesClient client)
    {
      return true;
    }

  }
}